package com.qf.j2105.service.impl;

import com.qf.j2105.mapper.CartMapper;
import com.qf.j2105.po.CarCollect;
import com.qf.j2105.po.Cart;
import com.qf.j2105.service.CartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CartServiceimpl implements CartService {
    @Resource
    CartMapper cartMapper;


    @Override
    public List<CarCollect> selectall(Integer uid) {
        List<CarCollect> selectone = cartMapper.selectone(uid);
        return selectone;
    }

    @Override
    public Cart addone(Cart cart) {
        Integer addcarcollect = cartMapper.addcarcollect(cart);
     if (addcarcollect>-1){
         return cart;
     }
        return null;
    }
}
